<!-- 基于sortable的可拖拽控件 -->
<sortable>
  <script>
    var tag = this;
    tag.fn = {};
    tag.on('mount', function(){

      var cfg = {
        group: opts.group,
        sort: (opts.sort || 1) == 0 ? false : true,
        animation: 100,
        onEnd: opts.onEnd || function(){},
        onAdd: opts.onAdd || function(){}
      };

      if(pip.typeOf(Sortable) !== 'Function') throw '请加载sortable.js模块';
      if(!opts.sortRef) return tag.app.log('请为sortable设置sort-ref属性');
      if(!opts.group) return tag.app.log('请为sortable设置group属性');

      // eg: drag-item='.drag-item' 可拖拽排序对象
      if(opts.dragItem) cfg.draggable = opts.dragItem;
      // eg: drag-handle='.drag-handle' 拖拽点
      if(opts.dragHandle) cfg.handle = opts.dragHandle;

      new Sortable(tag.parent.refs[opts.sortRef], cfg);

    });
  </script>
</sortable>
